package com.keensense.vcm.model;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import com.keensense.vcm.model.enums.AlarmLevelEnum;
import com.keensense.vcm.model.enums.AlarmTypeEnum;

/**
 * @author lanjian
 * @date 2020/5/28 4:19 下午
 */
@XmlRootElement(name = "response")
public class SearchSuspectTaskResponse extends BaseResponse{

    @XmlElement
    private Integer total;

    @XmlElementWrapper(name = "suspectList")
    @XmlElement(name = "suspect")
    private List<Suspect> suspectList;

    @XmlTransient
    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    @XmlTransient
    public List<Suspect> getSuspectList() {
        return suspectList;
    }

    public void setSuspectList(List<Suspect> suspectList) {
        this.suspectList = suspectList;
    }

    public static class Suspect {

        /**
         * 发送方域编码
         */
        @XmlElement
        private String srcDomainCode;

        /**
         * 发送方域名称
         */
        @XmlElement
        private String srcDomainName;

        /**
         * 布控id
         */
        @XmlElement
        private String suspectId;

        /**
         * 布控名称
         */
        @XmlElement
        private String name;

        /**
         * <p>
         * 任务类型 1：表示车辆黑名单布控
         * </p>
         * <p>
         * 2：表示人脸黑名单布控
         * </p>
         * <p>
         * 3：表示人脸白名单布控
         * </p>
         * <p>
         * 4：打标签任务
         * </p>
         * <p>
         * 5：表示车辆白名单布控
         * </p>
         * <P>
         * 101：表示车辆特征支持黑名单布控
         * </P>
         * <p>
         * 501：表示车辆特征支持白名单布控
         * </p>
         */
        @XmlElement
        private AlarmTypeEnum type;

        @XmlElement
        private Boolean enable;
        /**
         * 布控生效开始日期，时间格式YYYY-MM-DD
         */
        @XmlElement
        private String startDate;

        /**
         * 布控生效结束日期，时间格式YYYY-MM-DD
         */
        @XmlElement
        private String endDate;

        /**
         * 布控生效时间片段
         */
        @XmlElementWrapper(name = "timeList")
        @XmlElement(name = "time")
        private List<Time> timeList;

        /**
         * 本域卡口列表
         */
        @XmlElementWrapper(name = "bayonetList")
        @XmlElement(name = "bayonet")
        private List<Bayonet> bayonetList;

        @XmlElementWrapper(name = "libraryList")
        @XmlElement(name = "library")
        private List<Library> libraryList;

        @XmlElementWrapper(name = "groupList")
        @XmlElement(name = "group")
        private List<Group> groupList;

        /**
         * 布控返回topN命中告警，默认值返回1个。当前只支持人脸告警，其他布控场景无效。取值范围[1,10]
         */
        @XmlElement
        private Integer topN;

        @XmlElementWrapper(name = "unSuspectedLibraryList")
        @XmlElement(name = "libraryId")
        private List<String> unSuspectedLibraryList;

        @XmlElement
        private AlarmLevelEnum alarmLevel;

        /**
         * 1，表示命中布控 2，表示非命中布控,默认命中布控
         */
        private Integer hitType;

        @XmlElement
        private String confidenceThreshold;

        @XmlTransient
        public String getSrcDomainCode() {
            return srcDomainCode;
        }

        public void setSrcDomainCode(String srcDomainCode) {
            this.srcDomainCode = srcDomainCode;
        }

        @XmlTransient
        public String getSrcDomainName() {
            return srcDomainName;
        }

        public void setSrcDomainName(String srcDomainName) {
            this.srcDomainName = srcDomainName;
        }

        @XmlTransient
        public String getSuspectId() {
            return suspectId;
        }

        public void setSuspectId(String suspectId) {
            this.suspectId = suspectId;
        }

        @XmlTransient
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @XmlTransient
        public AlarmTypeEnum getType() {
            return type;
        }

        public void setType(AlarmTypeEnum type) {
            this.type = type;
        }

        @XmlTransient
        public Boolean getEnable() {
            return enable;
        }

        public void setEnable(Boolean enable) {
            this.enable = enable;
        }

        @XmlTransient
        public String getStartDate() {
            return startDate;
        }

        public void setStartDate(String startDate) {
            this.startDate = startDate;
        }

        @XmlTransient
        public String getEndDate() {
            return endDate;
        }

        public void setEndDate(String endDate) {
            this.endDate = endDate;
        }

        @XmlTransient
        public List<Time> getTimeList() {
            return timeList;
        }

        public void setTimeList(List<Time> timeList) {
            this.timeList = timeList;
        }

        @XmlTransient
        public List<Bayonet> getBayonetList() {
            return bayonetList;
        }

        public void setBayonetList(List<Bayonet> bayonetList) {
            this.bayonetList = bayonetList;
        }

        @XmlTransient
        public List<Library> getLibraryList() {
            return libraryList;
        }

        public void setLibraryList(List<Library> libraryList) {
            this.libraryList = libraryList;
        }

        @XmlTransient
        public List<Group> getGroupList() {
            return groupList;
        }

        public void setGroupList(List<Group> groupList) {
            this.groupList = groupList;
        }

        @XmlTransient
        public Integer getTopN() {
            return topN;
        }

        public void setTopN(Integer topN) {
            this.topN = topN;
        }

        @XmlTransient
        public List<String> getUnSuspectedLibraryList() {
            return unSuspectedLibraryList;
        }

        public void setUnSuspectedLibraryList(List<String> unSuspectedLibraryList) {
            this.unSuspectedLibraryList = unSuspectedLibraryList;
        }

        @XmlTransient
        public AlarmLevelEnum getAlarmLevel() {
            return alarmLevel;
        }

        public void setAlarmLevel(AlarmLevelEnum alarmLevel) {
            this.alarmLevel = alarmLevel;
        }

        @XmlTransient
        public Integer getHitType() {
            return hitType;
        }

        public void setHitType(Integer hitType) {
            this.hitType = hitType;
        }

        @XmlTransient
        public String getConfidenceThreshold() {
            return confidenceThreshold;
        }

        public void setConfidenceThreshold(String confidenceThreshold) {
            this.confidenceThreshold = confidenceThreshold;
        }
    }

    public static class Time {
        /**
         * 0周日 1周一 2周二 3周三 4 周四 5周五 6周六
         */
        @XmlElement
        private Integer day;

        /**
         * 开始时间 格式为HH:mm:ss
         */
        @XmlElement
        private String startTime;
        /**
         * M string 结束时间 格式为HH:mm:ss
         */
        @XmlElement
        private String endTime;

        @XmlTransient
        public Integer getDay() {
            return day;
        }

        public void setDay(Integer day) {
            this.day = day;
        }

        @XmlTransient
        public String getStartTime() {
            return startTime;
        }

        public void setStartTime(String startTime) {
            this.startTime = startTime;
        }

        @XmlTransient
        public String getEndTime() {
            return endTime;
        }

        public void setEndTime(String endTime) {
            this.endTime = endTime;
        }
    }

    private static class Bayonet {
        /**
         * 卡口编码
         */
        @XmlElement
        private String sn;
        /**
         * 卡口名称
         */
        @XmlElement
        private String name;

        @XmlTransient
        public String getSn() {
            return sn;
        }

        public void setSn(String sn) {
            this.sn = sn;
        }

        @XmlTransient
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    public static class Library {

        /**
         * 静态库id
         */
        @XmlElement
        private String libraryId;
        /**
         * 静态库名称
         */
        @XmlElement
        private String name;
        /**
         * 打标签优先级。
         */
        @XmlElement
        private String piority;
        /**
         * 按相似度排序，取前topN个打标签。
         */
        @XmlElement
        private String topN;

        @XmlTransient
        public String getLibraryId() {
            return libraryId;
        }

        public void setLibraryId(String libraryId) {
            this.libraryId = libraryId;
        }

        @XmlTransient
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        @XmlTransient
        public String getPiority() {
            return piority;
        }

        public void setPiority(String piority) {
            this.piority = piority;
        }

        @XmlTransient
        public String getTopN() {
            return topN;
        }

        public void setTopN(String topN) {
            this.topN = topN;
        }
    }

    private static class Group {
        /**
         * M string 名单组id
         */
        @XmlElement
        private String id;
        /**
         * M string 名单组是否启用 true：启用 false：未启用
         */
        @XmlElement
        private Boolean enable;
        /**
         * M string 名单组name
         */
        @XmlElement
        private String name;

        @XmlTransient
        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @XmlTransient
        public Boolean getEnable() {
            return enable;
        }

        public void setEnable(Boolean enable) {
            this.enable = enable;
        }

        @XmlTransient
        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
